home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / Watcher / any_check.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-07-26  |  651 b   |  33 lines

  1. /*
  2.    any_check: check a value and make sure it has not changed at all.
  3.  
  4.    Kenneth Ingham
  5.  
  6.    Copyright (C) 1988 The University of New Mexico
  7. */
  8.  
  9. #include "defs.h"
  10.  
  11. any_check(value, last, cmd, name, line)
  12. char *value;
  13. struct everything *last;
  14. char *cmd, *name, *line;
  15. {
  16.     extern int line_ok;
  17.     char *to_string(), *previous;
  18.  
  19.     previous = to_string(last);
  20.     if (strcmp(value, previous) != 0) {
  21.         if (line_ok) {
  22.             printf("%s has a value which changed:\n", cmd);
  23.             printf("%s\n",line);
  24.         }
  25.         else
  26.             printf("Also, it had a string value change:\n");
  27.  
  28.         printf("where %s = '%s'; it was '%s'", name, value, previous);
  29.         printf("\n");
  30.         line_ok = False;
  31.     }
  32. }
  33.